<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Album_model extends Xt_model {

	protected $mTable = 'album';

	public function get_info_by_id($id, $fields='*')
	{
		return $this->get_by_id($id, $fields);
	}
        
    /**
     * 建立默认相册
     * @param type $id
     * @param number $insid, 默认0
     * @return 插入ID，false
     */
    public function addDefaultAlbum($id, $insid = 0)
    {
        $flag = false;
        if (is_numeric($id) && !empty($id) && is_numeric($insid)) {
            $data_album = array(
                'userid' => $id,
                'title' => '精选作品',
                'memo' => '系统默认',
                'kind' => 1,
                'status' => 1,
                'addtime' => time(),
                'insid'=> $insid
            );
            
            $flag = $this->insert($data_album);
        }
        
        return $flag;
    }
}